/*This file is part of AENIMA. AENIMA is a module of BCI++ framework for the implementation of brain computerinterface systems. 
AEnima is intended for use with BCI++ only.

BCI++ is a project of the Sensibilab of the Politecnico di Milano. 

AENIMA is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as 
published by the Free Software Foundation, either version 3 of 
the License, or (at your option) any later version.

AENIMA is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU General Public License
and the GNU Lesser General Public License along with AENIMA.  
If not, see <http://www.gnu.org/licenses/>.*/

/*!
	\file	SocketThread.h
	 Header file for SocketThread
	 
	\author	sensibilab E-Mail: info.sensibilab@polimi.it

	\date	2007-09-06 creation \n
		2009-01-27 last modification

	\b COPYRIGHT: 
		This program is property of Sensibilab - Campus Ponit - Lecco
*/

#include	"Constants.h"
#include	"SocketComm.h"
#include	"structs\BCIMessage.h"
#include	"Led\LedDriver.h"
#include	<irrlicht.h>

using namespace irr;

#pragma comment(lib, "Irrlicht.lib")

struct ThreadDataStruct
{
	int	GoOn;
	SocketComm mySock;
	BCIMessage bufDataIn;
	LedDriver	myLed;
	IrrlichtDevice* myDevice;
	SEvent	event;
};

DWORD WINAPI RecvThread( LPVOID lpParam );
DWORD WINAPI SendThread( LPVOID lpParam );
void CreateRecvThread(int *isWindowActive, SocketComm *mySock, LedDriver *myLed, IrrlichtDevice *myDevice);
void GetIncomingData(char *buffer);
void ReleaseSocketThread(void);
void StopRecvThread(void);
void StartRecvThread(void);
